<template>
  <div class="giftCount">
    <div class="commodityTable up-space">
      <el-table
        :data="countTable"
        :header-row-style="headColor"
      >
        <el-table-column
          prop="commodity"
          label="商品"
        />
        <el-table-column
          prop="amount"
          label="金额"
        />
        <el-table-column
          prop="discount"
          label="折扣"
        />
        <el-table-column
          prop="payUser"
          label="支付用户"
        />
        <el-table-column
          prop="payOrder"
          label="支付订单"
        />
        <el-table-column
          prop="payAmount"
          label="支付金额"
        />
      </el-table>
    </div>
    <el-form model="searchForm">
      <div class="search-box">
        <el-col :span="6" class="up-space">
          <el-form-item label="手机号:">
            <el-col :span="18">
              <el-input v-model="searchForm.tel" placeholder="输入手机号码搜索" />
            </el-col>
          </el-form-item>
        </el-col>
        <el-col :span="6" class="el-col-offset-3 up-space">
          <el-form-item label="商品:">
            <el-col :span="18">
              <el-input v-model="searchForm.commodity" placeholder="商品" />
            </el-col>
          </el-form-item>
        </el-col>
        <el-col :span="6" class="el-col-offset-3 up-space">
          <el-form-item label="订单号:">
            <el-col :span="18">
              <el-input v-model="searchForm.orderCode" placeholder="订单号" />
            </el-col>
          </el-form-item>
        </el-col>
        <el-col :span="24" class="up-space">
          <el-col :span="6">
            <el-form-item label="门店:">
              <el-select v-model="searchForm.shop" placeholder="请选择门店" style="margin-left: 14px;">
                <el-option label="门店一" value="shanghai" />
                <el-option label="门店二" value="beijing" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-col>
        <el-col :span="24" class="up-space">
          <el-button type="primary" style="margin-left: 60px;">筛选</el-button>
        </el-col>
      </div>
    </el-form>
    <div class="userTable up-space">
      <el-table
        :data="userTable"
        :header-row-style="headColor"
        stripe
      >
        <el-table-column
          type="index"
          label="序号"
        />
        <el-table-column
          prop="user"
          label="购买用户"
        />
        <el-table-column
          prop="tel"
          label="手机号码"
        />
        <el-table-column
          prop="commodity"
          label="商品"
        />
        <el-table-column
          prop="amount"
          label="金额"
        />
        <el-table-column
          prop="type"
          label="类型"
        />
        <el-table-column
          prop="time"
          label="领取时间"
        />
        <el-table-column
          fixed="right"
          label="操作"
        >
          <template slot-scope="scope">
            <el-button
              type="text"
              size="small"
              @click.native.prevent="deleteRow(scope.$index, tableData)"
            >
              查看详情
            </el-button>
          </template>
        </el-table-column>
      </el-table>
      <el-pagination
        class="pagination-right"
        :page-sizes="[15, 20, 25, 30]"
        :page-size="15"
        :total="400"
        layout="total, sizes, prev, pager, next, jumper"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
      />
    </div>
  </div>
</template>

<script>
export default {
  name: 'GiftCount',
  data() {
    return {
      headColor: { background: '#F3F3F3' },
      searchForm: {},
      countTable: [
        {
          commodity: '手动轮椅 HBG25',
          amount: { discountAmount: '￥14', orginalAmount: '￥20' },
          discount: '7折',
          payUser: '20',
          payOrder: '20',
          payAmount: '￥20'
        },
        {
          commodity: '纸尿裤 规格:M',
          amount: { discountAmount: '￥14', orginalAmount: '￥20' },
          discount: '7折',
          payUser: '20',
          payOrder: '20',
          payAmount: '￥20'
        },
        {
          commodity: '纸尿裤 规格:L',
          amount: { discountAmount: '￥14', orginalAmount: '￥20' },
          discount: '7折',
          payUser: '20',
          payOrder: '20',
          payAmount: '￥20'
        }
      ],
      userTable: [
        {
          user: '哈哈哈',
          tel: '15896523652',
          commodity: '纸尿裤 M',
          amount: '￥20',
          type: '赠送',
          time: '2019-06-24 12:00'
        }
      ]
    }
  }
/* methods: {
    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
            if (columnIndex === 0) {
              if (rowIndex % 2 === 0) {
                return {
                  rowspan: 2,
                  colspan: 1
                };
              } else {
                return {
                  rowspan: 0,
                  colspan: 0
                };
              }
            }
          }
  } */
}
</script>

<style lang="scss" scoped>
.giftCount {
  padding: 10px 0px;
  .headerColor{
    background: #F3F3F3;
  }
  ::v-deep.el-table th{
    background: #F3F3F3;
  }
  .up-space{
    margin: 20px 0px;
  }
  .search-box{
    padding:20px 0px;
    height: 300px;
    background: #F3F3F3;
    /* .up-space{
      margin-top: 30px;
    } */
  }
}
</style>
